import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StockCheckVO, StockCheckForm, StockCheckQuery } from '@/api/wms/stockCheck/types';

/**
 * 查询库存盘点列表
 * @param query
 * @returns {*}
 */

export const listStockCheck = (query?: StockCheckQuery): AxiosPromise<StockCheckVO[]> => {
  return request({
    url: '/wms/stockCheck/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询库存盘点详细
 * @param id
 */
export const getStockCheck = (id: string | number): AxiosPromise<StockCheckVO> => {
  return request({
    url: '/wms/stockCheck/' + id,
    method: 'get'
  });
};

/**
 * 新增库存盘点
 * @param data
 */
export const addStockCheck = (data: StockCheckForm) => {
  return request({
    url: '/wms/stockCheck',
    method: 'post',
    data: data
  });
};

/**
 * 修改库存盘点
 * @param data
 */
export const updateStockCheck = (data: StockCheckForm) => {
  return request({
    url: '/wms/stockCheck',
    method: 'put',
    data: data
  });
};

/**
 * 删除库存盘点
 * @param id
 */
export const delStockCheck = (id: string | number | Array<string | number>) => {
  return request({
    url: '/wms/stockCheck/' + id,
    method: 'delete'
  });
};
